package dao;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import pojo.Account;
import pojo.People;

import java.util.List;
@Component
public interface AccountTD {
    @Select("select * from account_tb limit 50")
     List<People> selectListPeople();
    @Select ("select * from account_tb where id=#{account.id} ")
    @ResultType(Account.class)
     Account selectPeopleById(@Param("account") Account account);
    @Select("select id from account_tb where id=#{account.id} and password =#{account.password}")
     String selectPeople(@Param("account") Account account);
    @Insert("INSERT INTO account_tb(id,password) values(#{id},#{password})")
     boolean createAccount(@Param("id") String id,@Param("password") String password);
    @Delete("delete from account_tb where id=#{id}")
     int deteleIdAccount(@Param("id") String id);
    @Insert("insert into user_tb values(#{id},0)")
    int insertUser(@Param("id") String id);
    @Insert("insert into friend_tb values(#{id_m},#{id_f},0)")
    int insertFriend(@Param("id_m") String id_m,@Param("id_f") String id_f);
}
